/*
 * Copyright (c) 2014-2015, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 *
 * TodoActions
 */

const AppDispatcher = require('../dispatcher/AppDispatcher');
const TodoConstants = require('../constants/TodoConstants');

const TodoActions = {
  _create(text) {
    AppDispatcher.dispatch({
      actionType: TodoConstants.CREATE,
      text: text
    });
  },

  _delete(index) {
    AppDispatcher.dispatch({
      actionType: TodoConstants.DELETE,
      index: index
    });
  },

  _editor(index, text) {
    AppDispatcher.dispatch({
      actionType: TodoConstants.EDITOR,
      text: text,
      index: index
    });
  },

  _stateChange(index) {
    AppDispatcher.dispatch({
      actionType: TodoConstants.STATE,
      index: index
    });
  }
};

module.exports = TodoActions;
